package com.liruo.springframework.core.aop.designator.l2annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class AnnotationAspect {
  @Retention(RetentionPolicy.RUNTIME)
  @Target(ElementType.METHOD)
  @Documented
  public @interface AspectAnno{}

  public static String returnAndStatus = null;
  @AfterReturning(
      value = "@annotation(anno)",
      returning = "rtv")
  public void simple(String rtv, AspectAnno anno){
    returnAndStatus = AnnotationAspect.class.getSimpleName() + rtv;
  }
}
